# Maintainer: Andreas Radke <andyrtr@archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>

pkgname=libxpm
pkgver=3.5.16
pkgrel=1
pkgdesc="X11 pixmap library"
arch=('x86_64')
license=('custom')
url="https://xorg.freedesktop.org/"
depends=('libxt' 'libxext')
makedepends=('xorg-util-macros')
source=(${url}/releases/individual/lib/libXpm-${pkgver}.tar.xz{,.sig})
sha512sums=('ee564311f8c1c9c08ed1035d55c287ecf7c20c6fee09ad448acfab59f38fd1ef381d4a24b4af2b581f3033730eebc7c690918e52ba706de689d1ef11085edac2'
            'SKIP')
#validpgpkeys=('C41C985FDCF1E5364576638B687393EE37D128F8') # Matthieu Herrb <matthieu.herrb@laas.fr>
#validpgpkeys+=('3C2C43D9447D5938EF4551EBE23B7E70B467F0BF') # "Peter Hutterer (Who-T) <office@who-t.net>"
#validpgpkeys=('4A193C06D35E7C670FA4EF0BA2FB9E081F2D130E') # Alan Coopersmith <alan.coopersmith@oracle.com>
validpgpkeys=('3BB639E56F861FA2E86505690FDD682D974CA72A') # Matt Turner <mattst88@gmail.com>

build() {
  cd libXpm-${pkgver}
  ./configure --prefix=/usr \
    --sysconfdir=/etc \
    --disable-static \
    --disable-open-zfile
  make
}

check() {
  cd libXpm-${pkgver}
  # 3 test fails due to disabling compression support from 3.5.15 on
  make check || /bin/true
}

package() {
  cd libXpm-${pkgver}
  make DESTDIR="${pkgdir}" install

  install -m755 -d "${pkgdir}"/usr/share/licenses/${pkgname}
  install -m644 COPYING "${pkgdir}"/usr/share/licenses/${pkgname}/
}
